package com.rampage.multitimers.handler;

import com.rampage.multitimers.Main;
import com.rampage.multitimers.view.TimerView;

import android.os.Handler;
import android.os.Message;
import android.speech.tts.TextToSpeech;

public class TimerHandler extends Handler {
	
    private Timer timer;
    private TimerView view;
	
	public TimerHandler(TimerView view) {
		this.view = view;
		timer = new Timer(this);
		//startTimers();
	}

    public void handleMessage(Message msg) {
    	if (msg.what == Timer.WHAT_DEC) {
    		view.dec();
    	}
    }

    public void startTimers() {
        this.postDelayed(this.timer, 1000); 
    }

    public void stopTimers() {
        this.removeCallbacks(timer);
    }
    
}
